package com.huabo.utils;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.io.Serializable;

/**
 * Created by Jackie Liu on 2017/4/9.
 */
public class Tree implements Serializable {

    /**
     * <p>Field serialVersionUID: 序列号</p>
     */
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pId;
    private String name;
    private boolean open = false;

    private Object data;

    public Tree() {

    }

    /*public Tree(String id, String pId, String name) {
        this(id, pId, name, false, null);
    }

    public Tree(String id, String pId, String name, Object data) {
        this(id, pId, name, false, data);
    }

    public Tree(String id, String pId, String name, boolean open) {
        this(id, pId, name, open, null);
    }

    public Tree(String id, String pId, String name, boolean open, Object data) {
        this.id = id;
        this.pId = pId;
        this.name = name;
        this.open = open;
        this.data = data;
    }*/

    public Tree(Long id, Long pId, String name) {
        this(id, pId, name, false, null);
    }

    public Tree(Long id, Long pId, String name, Object data) {
        this(id, pId, name, false, data);
    }

    public Tree(Long id, Long pId, String name, boolean open) {
        this(id, pId, name, open, null);
    }

    public Tree(Long id, Long pId, String name, boolean open, Object data) {
        this.id = id;
        this.pId = pId;
        this.name = name;
        this.open = open;
        this.data = data;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getpId() {
        return pId;
    }

    public void setpId(Long pId) {
        this.pId = pId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean getOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }
}
